Optimal. Leaf size=62 \[ -\frac{(d g+e f)^2 \log (d-e x)}{2 d e^3}+\frac{(e f-d g)^2 \log (d+e x)}{2 d e^3}-\frac{g^2 x}{e^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0800188, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.136, Rules used = {702, 633, 31} \[ -\frac{(d g+e f)^2 \log (d-e x)}{2 d e^3}+\frac{(e f-d g)^2 \log (d+e x)}{2 d e^3}-\frac{g^2 x}{e^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 702
Rule 633
Rule 31
Rubi steps
\begin{align*} \int \frac{(f+g x)^2}{d^2-e^2 x^2} \, dx &=\int \left (-\frac{g^2}{e^2}+\frac{e^2 f^2+d^2 g^2+2 e^2 f g x}{e^2 \left (d^2-e^2 x^2\right )}\right ) \, dx\\ &=-\frac{g^2 x}{e^2}+\frac{\int \frac{e^2 f^2+d^2 g^2+2 e^2 f g x}{d^2-e^2 x^2} \, dx}{e^2}\\ &=-\frac{g^2 x}{e^2}-\frac{(e f-d g)^2 \int \frac{1}{-d e-e^2 x} \, dx}{2 d e}+\frac{(e f+d g)^2 \int \frac{1}{d e-e^2 x} \, dx}{2 d e}\\ &=-\frac{g^2 x}{e^2}-\frac{(e f+d g)^2 \log (d-e x)}{2 d e^3}+\frac{(e f-d g)^2 \log (d+e x)}{2 d e^3}\\ \end{align*}
Mathematica [A] time = 0.0221898, size = 55, normalized size = 0.89 \[ \frac{\left (d^2 g^2+e^2 f^2\right ) \tanh ^{-1}\left (\frac{e x}{d}\right )-d e g \left (f \log \left (d^2-e^2 x^2\right )+g x\right )}{d e^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.049, size = 107, normalized size = 1.7 \begin{align*} -{\frac{{g}^{2}x}{{e}^{2}}}-{\frac{d\ln \left ( ex-d \right ){g}^{2}}{2\,{e}^{3}}}-{\frac{\ln \left ( ex-d \right ) fg}{{e}^{2}}}-{\frac{\ln \left ( ex-d \right ){f}^{2}}{2\,de}}+{\frac{d\ln \left ( ex+d \right ){g}^{2}}{2\,{e}^{3}}}-{\frac{\ln \left ( ex+d \right ) fg}{{e}^{2}}}+{\frac{\ln \left ( ex+d \right ){f}^{2}}{2\,de}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.992196, size = 111, normalized size = 1.79 \begin{align*} -\frac{g^{2} x}{e^{2}} + \frac{{\left (e^{2} f^{2} - 2 \, d e f g + d^{2} g^{2}\right )} \log \left (e x + d\right )}{2 \, d e^{3}} - \frac{{\left (e^{2} f^{2} + 2 \, d e f g + d^{2} g^{2}\right )} \log \left (e x - d\right )}{2 \, d e^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.74218, size = 165, normalized size = 2.66 \begin{align*} -\frac{2 \, d e g^{2} x -{\left (e^{2} f^{2} - 2 \, d e f g + d^{2} g^{2}\right )} \log \left (e x + d\right ) +{\left (e^{2} f^{2} + 2 \, d e f g + d^{2} g^{2}\right )} \log \left (e x - d\right )}{2 \, d e^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 0.733054, size = 112, normalized size = 1.81 \begin{align*} - \frac{g^{2} x}{e^{2}} + \frac{\left (d g - e f\right )^{2} \log{\left (x + \frac{2 d^{2} f g + \frac{d \left (d g - e f\right )^{2}}{e}}{d^{2} g^{2} + e^{2} f^{2}} \right )}}{2 d e^{3}} - \frac{\left (d g + e f\right )^{2} \log{\left (x + \frac{2 d^{2} f g - \frac{d \left (d g + e f\right )^{2}}{e}}{d^{2} g^{2} + e^{2} f^{2}} \right )}}{2 d e^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.12473, size = 109, normalized size = 1.76 \begin{align*} -g^{2} x e^{\left (-2\right )} - f g e^{\left (-2\right )} \log \left ({\left | x^{2} e^{2} - d^{2} \right |}\right ) - \frac{{\left (d^{2} g^{2} + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (\frac{{\left | 2 \, x e^{2} - 2 \,{\left | d \right |} e \right |}}{{\left | 2 \, x e^{2} + 2 \,{\left | d \right |} e \right |}}\right )}{2 \,{\left | d \right |}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]